
    $('.a-e-i img').each(function(){
          $(this).parent('a').css({'width':'100%','height':'100%','display': 'block','overflow':' hidden'});
            
             var  wd = $(this).parent().width();
             var  hd = $(this).parent().height();
             var  wimg_a = $(this).width();
             $(this).width("100%").end();
             var  himg_a = $(this).height();
            if(himg_a > hd){
        
                 $(this).css({"margin-top":-Math.abs(himg_a - hd)/2});
            }else if(himg_a <= hd){
                 $(this).css({"height":"100%","width":"100%"});
            }

          
  });
$(".c-e-i img").each(function(){
          $(this).parent('a').css({'width':'100%','height':'100%','display': 'block','overflow':' hidden'});
              var  wd = $(this).parent().width();
             var  hd = $(this).parent().height();
             var  wimg_a = $(this).width();
             var  himg_a = $(this).height();
             
         if(wimg_a > himg_a){
        $(this).css({"height":"100%"}).end();
         wimg = $(this).width();
         if(wimg < wd){
             $(this).css({"width":"100%"});
         }else if(wimg > wd){
              $(this).css({"margin-left":-Math.abs((wimg - wd)/2)}); 
         } 
   }else if(wimg_a < himg_a){
      $(this).css({"width":"100%"}).end(); 
       himg = $(this).height();
        if(himg < hd){
             $(this).css({"height":"100%"});
         }else if(himg > hd){
               $(this).css({"margin-top":-Math.abs(himg - hd)/2});
         }
    }else if(wimg_a === himg_a){
        $(this).css({"height":"100%","width":"100%"});
    } 
});
	 
//�����ˆ�
$(".estate_select,.rantal_select,.new_property .estate_select").hover(function(){},function(){
    $(".estate_select ul,.rantal_select ul,.new_property .estate_select ul").hide();
});
$(".estate_select").click(function(){

    $(this).find("ul").slideToggle("fast");
});
$('.rantal_select .search_ico').click(function(){
    $(this).parents('.rantal_select').find('ul').slideToggle("fast");
});
$(".estate_select ul li,.rantal_select ul li").click(function(){
 $(this).parents(".estate_select,.rantal_select").find(".select_title span").text($(this).text());
  $(this).parents(".estate_select,.rantal_select").find(".select_title input").val($(this).text());
 $(this).parent().slideToggle("fast");
});



//phone_nav
$(".nav_top .phone_nav").click(function(){
	$(".nav_top ul").slideToggle();
	$(".nav_top a").click(function(){
	$(".nav_top ul").hide();
	});	
	});

//hover_img
	$(".col_img").hover(function(){
		$(this).find(".hover_img").show();
		},function(){
			$(".hover_img").hide();	
			});
			
//�c��Ӯ�

	  
$(".scroll").click(function(event){		
					
					$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
					
				
				});	





//prettyPhoto	
 $("area[rel^='prettyPhoto']").prettyPhoto();

$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'normal', theme: 'light_square', slideshow: 30000, autoplay_slideshow: true});
$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'fast', slideshow: 10000, hideflash: true});

$(".img_ico").click(function(){
	
	$(".pp_none").show();
	});


//goto top
$(window).scroll(function(){
 $(this).scrollTop()>1? $('.go_top i').show(): $('.go_top i').hide(); 
});
function goTop(){
	$('html,body').animate({'scrollTop':0},600);
}



//nav
$(document).ready(function(){
	var $liCur = $(".nav_top ul li.cur"),
	  curP = $liCur.position().left,
	  curW = $liCur.outerWidth(true),
	  $slider = $(".curBg"),
	  $navBox = $(".nav_top");
	 $targetEle = $(".nav_top ul li a"),
	$slider.animate({
	  "left":curP,
	  "width":curW
	});
	$targetEle.mouseenter(function () {
	  var $_parent = $(this).parent(),
		_width = $_parent.outerWidth(true),
		posL = $_parent.position().left;
	  $slider.stop(true, true).animate({
		"left":posL,
		"width":_width
	  }, "fast");
	});
	$navBox.mouseleave(function (cur, wid) {
	  cur = curP;
	  wid = curW;
	  $slider.stop(true, true).animate({
		"left":cur,
		"width":wid
	  }, "fast");
	});
});


 var swiper1 = new Swiper('.swiper1', {
       pagination: '.swiper-pagination1',
        nextButton: '.swiper-button-next1',
        prevButton: '.swiper-button-prev1',
        paginationClickable: true,
        spaceBetween: 30
      
    });

     
